<template>
  <div>
    我的
    <van-button type="danger" @click="outlogin">退出登录</van-button>
  </div>
</template>
<script>
export default {
  data() {
    return {};
  },
  methods: {
    outlogin() {
      this.$store.commit("outlogin");
      this.$router.push("/app/login");
    },
  },
  beforeRouteEnter(to, from, next) {
    // ...
    next((vm) => {
      if (vm.$store.state.token == "") {
        vm.$router.push("/app/login");
      }
    });
  },
};
</script>